fix: support custom Git hosts in getOwnerRepo for lockfile tracking#223
Conversation
The getOwnerRepo() function previously only recognized github.com and gitlab.com URLs, causing skills installed from self-hosted Git servers to not be tracked in the lockfile. Updated the regex to match any HTTPS Git URL with an owner/repo structure, enabling lockfile tracking for skills installed from any Git host.
|
@quuu Ran into this issue when using |
Local TestingTested the fix locally against a self-hosted GitLab instance: # Build from source
pnpm build
# Install skills from self-hosted GitLab
node dist/cli.mjs add https://git.example.io/team/skills.git --agent claude-code -y -gBefore fix: Lockfile remained empty ( After fix: Lockfile correctly tracks all installed skills: {
"version": 3,
"skills": {
"skill-1": {
"source": "team/skills",
"sourceType": "git",
"sourceUrl": "https://git.example.io/team/skills.git",
"skillPath": "skill-1/SKILL.md",
"skillFolderHash": "",
"installedAt": "2026-01-30T17:29:08.822Z",
"updatedAt": "2026-01-30T17:29:08.822Z"
},
...
}
}The Note: |
…rRepo - Replace regex with URL parsing for cleaner handling of edge cases - Strip query strings (?ref=main) and fragments (#readme) from URLs - Support GitLab nested paths (group/subgroup/repo) - Add 7 new test cases covering these scenarios Addresses review feedback from Devin. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addressed Review FeedbackThanks for the review! I've pushed changes to address the feedback: Fixed: Query strings and URL fragments (Issue #1)URLs like Added: GitLab subgroups support (Issue #2)The function now supports nested GitLab paths:
ImplementationReplaced the regex approach with URL parsing which cleanly handles all edge cases:
Added 7 new test cases covering these scenarios. |
Summary
getOwnerRepo()to support any HTTPS Git host with anowner/repoURL structureProblem
The
getOwnerRepo()function only recognizedgithub.comandgitlab.comURLs:This caused skills installed from self-hosted Git servers to return
null, which skipped the lockfile update inadd.ts:1827:Solution
Replaced the regex with URL parsing for cleaner handling:
This approach:
group/subgroup/repo)owner/repostructureTest plan
owner/repoinstead ofnull?ref=main)#readme)🤖 Generated with Claude Code